package com.ql.design.observer;

import java.util.Enumeration;
import java.util.Vector;

public abstract class ABstractSubject implements Subject {
	private Vector<Observer> vect = new Vector<Observer>();
	
	
	@Override
	public void attach(Observer obs) {
		vect.add(obs);
	}

	@Override
	public void deltach(Observer obs) {
		vect.remove(obs);
	}

	@Override
	public void notifyObsers() {
		Enumeration<Observer> em = vect.elements();
		while(em.hasMoreElements()){
			em.nextElement().update();
		}

	}

	

}
